Return to doc.sitecore.com

Displaying a Sheer Application When a User Logs into the Sitecore Desktop
Prev Next

Author: Alexander Tsvirchkov
Posted: 3/14/2006 3:49:55 PM

Sitecore versions: tested with 5.1.1.11. Expected to work with 5.1.1.x releases.

Follow the steps below to implement this functionality.

1. Copy \Sitecore\shell\Applications\Shell.xml to the \Sitecore\shell\override\ folder.

2. Include a custom Jscript code in Shell.xml:

<FormPage Submittable="false">

<Stylesheet Src="Startbar.css"/>

<Script type="text/JavaScript" language="javascript" src="controls/SitecoreObjects.js" Form="true"/>

<Script type="text/JavaScript" language="javascript" src="controls/SitecoreWindowManager.js" Form="true"/>

<Script type="text/JavaScript" language="javascript" src="override/customjs.js" Form="true"/>

...

3. Create customjs.js Jscript file in the \sitecore\shell\override\ folder:

function myStartUp(){

   if (typeof(window.scForm) == 'undefined') {

      setTimeout('myStartUp()', 1000);

   }

   else

   {

      window.scForm.postRequest("", "", "", "custom:startup");

   }

}

// Load

setTimeout('myStartUp()', 1000);

4. Create a message class which will be able to catch the “custom:startup” message:

namespace StartCustomMessage

{

  public class MyCustomMessage

  {

      public void OnStartUp(Message args)

      {

         Windows.RunApplication("Content Editor");

      }

  }

}

This message runs the Content Editor application. Compile this code to the StartCustomMessage assembly and place it to the /bin folder.

5. Register the message in the web.config file:

<messages>

...

<message name="custom:startup" type="StartCustomMessage.MyCustomMessage,StartCustomMessage" method="OnStartUp"/>

...

</messages>

Result: when you log into the Sitecore Client, the Content Editor is started.   

Note: you should keep in mind the timing in setTimeout('myStartUp()', 1000). If you make this value too small, for example 100, it may not work as expected because Sitecore may not load all necessary HTML client code in time (scForm, scManager, etc).


Prev Next